#include <bits/stdc++.h>
using namespace std;

int a[100020], vis[100020];

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    int n, l = 1, r = 2,ans=0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    while (l <= n && r <= n)
    {
        if (a[r] > a[l] && vis[r] == 0)
        {
            a[l] = 0;
            vis[r] = 1;
            l++;
            r++;
        }
        else
        {
            r++;
        }
    }
    for (int i = 1; i <= n; i++)
    {
        if (a[i] != 0) ans++;
    }
    cout << ans;
    return 0;
}
